<template>
  <section class="index">
    <h1>B应用 /a页面</h1>
    <div>{{ microAppProps }}</div>
    <button @click="navigateTo">跳到B应用 /b页面</button>
    <button @click="getElement">获取body节点</button>
    <div>
      <p>tinymce富文本</p>
      <textarea id="mytextarea">Hello, World!</textarea>
    </div>
  </section>
</template>

<script lang="ts" setup>
import { onMounted } from "vue";
import { useRouter } from "vue-router";
import { microAppProps } from '../microapp';

const router = useRouter();
function navigateTo() {
  router.push("/b");
}
function getElement() {
  console.log(document.getElementsByTagName("body"));
}

onMounted(() => {
  (<any>window).tinymce?.init({
    selector: '#mytextarea',
  });
})
</script>

<style scoped>
.index {
  width: 100%;
}
button {
  color: blue;
}
</style>
